# Overriding the default settings

A transformation can be defined that overrides the topic, partition and message key settings defined in the General tab.

Information note

Before you can define such a transformation, you first need to add a source endpoint to the task and select the tables you want to replicate.

To define a transformation:

1. Open the task you defined.

2. If you are defining a transformation for a single table, select one of the source tables. Otherwise, skip to Step 3.

3. Define a transformation that adds one of the following columns:

   Information note

   The columns listed below (prefixed with a `$`) instruct Replicate to route the message to the desired topic and/or partition, and will *not* be included in the actual message itself.

   * `$topic` - To write messages to a specific topic.
   * `$partition` - To write messages to a specific partition.
   * `$key` - To create a custom message key.

   For information on creating a transformation for a single table, see [Defining transformations for a single table/view](https://help.qlik.com/en-US/replicate/May2026/Content/Global_Common/Content/SharedEMReplicate/Customize%20Tasks/tasks_transformations.htm).

   For information on creating a global transformation rule, see [Starting the Global Transformation Rules wizard](https://help.qlik.com/en-US/replicate/May2026/Content/Global_Common/Content/SharedEMReplicate/Customize%20Tasks/tasks_newTransRuleWiz.htm).

4. Define an expression for the new column that returns the following values:

   * For a `$topic` column, the expression should return the topic name.
   * For a `$partition` column, the expression should return the partition number. Note that an error will be returned during runtime if the partition number does not exist.
   * For a `$key` column, the expression should return the message key contents. Note that the expression must return a non-empty value.

   For information on creating expressions, see [Using the Expression Builder](https://help.qlik.com/en-US/replicate/May2026/Content/Global_Common/Content/SharedEMReplicate/Customize%20Tasks/task_expression_builder.htm).